package org.bzjj.sql;

import java.util.HashMap;

public class SqlInsert {
	private static String startInsert = "INSERT INTO ";
	private static String leftInsert = " (";
	private static String rightInsert = ") VALUES (";
	private static String endInsert = ")";
	public static String getInsert(String table, HashMap<String, String> value) {
		String[] keys = value.keySet().toArray(new String[0]);
		String[] values = value.values().toArray(new String[0]);

		String str = startInsert + Sql.getKey(table) + leftInsert
				+ Sql.getKeys(keys) + rightInsert + Sql.getValues(values)
				+ endInsert;
		
		return str;
	}
}
